<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-商品规格管理"> </@frame.head>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>上传</title>
<link rel="stylesheet"
	href="${contextPath}/resources/css/follow/reset.css" />
<link rel="stylesheet"
	href="${contextPath}/resources/css/font/iconfont.css" />
<link rel="stylesheet" href="${contextPath}/resources/css/follow/up.css" />

<script src="${contextPath}/resources/js/follow/jquery-1.8.3.js"
	type="text/javascript"></script>
<script src="${contextPath}/resources/js/follow/config.js"
	type="text/javascript"></script>
<script src="${contextPath}/resources/lib/layer/2.4/layer.js"
	type="text/javascript"></script>
<script src="${contextPath}/resources/js/follow/up.js"
	type="text/javascript"></script>
<script src="${contextPath}/resources/js/follow/picget.js"
	type="text/javascript"></script>
</head>
<body>
	<div class="follow-up">
		<div class="nav">
			<b>跟着学上传</b>
		</div>
		<!--基本信息-->
		<div class="base">
			<p class="basic">
				<i class="iconfont">&#xe69e;</i> <span><b>基本信息</b></span>
			</p>
			<form id="uploadForm" action="" method="post"
				enctype="multipart/form-data">
				<b>封面上传</b>
				<!--上传之后-->
				<div class="zhan yin" id="relace">
					<div class="picPlace">
						<img class="pic" id="imgload" /> <a href="javascript:;"
							class="removePic"> <i class="iconfont">&#xe669;</i>
						</a>
					</div>
				</div>
				<!--上传之前-->
				<div class="zhan" id="addPic">
					<label class="easyui-linkbutton" for="file"> <span>上传封面</span>
					</label> <input id="file" name="img" type="file"
						accept="image/jpeg,image/gif,image/png" / class="file2">
					<p style="margin-top: -20px;">支持jpg、png格式图片</p>
					<p>图片不得大于2M</p>
				</div>

				<!--名称-->
				<b>标题名称</b> <input type="text" id="text" name="text" value=""
					placeholder="请输入跟着学标题" /><br />
				<br />
				<br />

				<!--讲师姓名-->
				<b>讲师姓名</b> <input type="text" id="teacher" name="teacher" value=""
					placeholder="讲师姓名" /><br />
				<br />
				<br />

				<!--艺术专业-->
				<b>艺术专业</b> <select name="typeOne" id="draw"
					onchange="show(this.options[this.options.selectedIndex].value)">
					<option value="">请选择</option>
					<#list coursesTypeList as list>
					<option value="${list.id}">${list.coursesType}</option>
					</#list>
					<!--  <option value="其他" order="2">其他</option> -->
				</select>
				 <select name="typeTwo" id="cont">

				</select>
			</form>
			<!--内容上传-->
			<div id="shang">
				<p class="content">
					<i class="iconfont">&#xe69e;</i> <span><b>内容上传</b></span> <span
						style="font-size: 14px; color: #aaa; margin-left: 15px;">注：不要在图片上放置讲师商业推广信息（除案例信息外），不超过100张，支持批量上传。</span>
				</p>
				<!--中间输入框-->
				<div class="title">
					<input type="text" placeholder="请输入此页面标题" maxlength="10"
						/ class="p-biao" value=""><br /> <input type="text"
						placeholder="请输入此页面详情" maxlength="1000" class="p-xiang" value="" /><br />
					<input type="button" value="提交" class="submit" />
				</div>
				<div id="meng"></div>
				<ul id="list">
					<li id="pic"><a href="javascript:;" class="easyui"
						id="uploadImgBtn"> <span>上传图片</span> <input id="file2"
							class="file2" type="file" multiple form="uploadForm"
							accept="image/jpeg,image/gif,image/png" />
					</a>
						<p>支持jpg、png格式图片</p>
						<p>图片不得大于2M</p></li>

				</ul>
			</div>


			<!--上传-->
			<div class="cansle">
				<input type="submit" id="btn" value="上传" class="gai bian"> <input
					type="reset" id="btn2" value="取消" class="bian" />
			</div>
		</div>

	</div>
<script type="text/javascript">
			//上传和取消按钮
			$(".bian").on('click',function(){
				$(".bian").removeClass("gai");
				$(this).addClass("gai");
			})
var path="${contextPath}";
var sts;
sts="<option value>请选择</option>";
$("#cont").html(sts);
function show(type) {
	if (type=="") {
		var sts;
		sts="<option value>请选择</option>";
		$("#cont").html(sts);
	}else{ 
		 $.ajax({
			url : path+"/ftp/coursesType_Subctype?typeOne="+type,
			cache : false,
			type : 'post',
			dataType : 'json',
			error : function() {
				layer.alert("操作失败!");
			},
			success : function(message) {
				console.log(message)
        		if(message.code == "200"){
                    var arr=message.message;
                    var str;
                    for(var i=0;i<arr.length;i++){
                    	str=str+"<option value="+arr[i].id+" >"+arr[i].coursesType+"</option>";
                    }
                    $("#cont").html(str);
 				}else if(message == "500"){
 					layer.alert("系统繁忙！");
 				}else{
 					layer.alert(message);
 				}
			},complete: function(XMLHttpRequest, textStatus) {
				layer.close(layer_load_window);
			}
	  });
 	}
} 
		</script>
</body>
</html>